cmake_minimum_required(VERSION 3.12)
project(demo2)
 #设置C/C++源文件
set(CPP_SOURCE_FILES
    main.cpp
)
# 设置CUDA源文件
set(CUDA_SOURCE_FILES
      CudaService/add.cu
)
find_package(CUDA REQUIRED)
#添加包含文件目录
include_directories(${CUDA_INCLUDE_DIRS})
#构建cuda函数静态库
cuda_add_library(add ${CUDA_SOURCE_FILES})
#构建可执行文件
add_executable(prog  ${CPP_SOURCE_FILES})
#链接
target_link_libraries(prog add)

